package modelLayer;

public class SalesLine {
	private Product product;
	private int quantity;

	/**
	 * Constructor for creating the salesLine object.
	 * 
	 * @param product
	 * @param quantity
	 */
	public SalesLine(Product product, int quantity) {
		this.product = product;
		this.quantity = quantity;
	}

	public SalesLine() {
	}

	/**
	 * Method that calculates and returns the total amount on the salesLine.
	 *  
	 * @return			The calculated amount.
	 */
	public double calculateLineAmount() {
		double price = product.getSalesPrice();
		double amount = price * quantity;
		return amount;
	}


	/**
	 * @return the product
	 */
	public Product getProduct() {
		return product;
	}


	/**
	 * @param product the product to set
	 */
	public void setProduct(Product product) {
		this.product = product;
	}


	/**
	 * @return the quantity
	 */
	public int getQuantity() {
		return quantity;
	}


	/**
	 * @param quantity the quantity to set
	 */
	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}
	
}
